import { default } from './chat.vue';
<template>
  <video ref="video"></video>
</template>

<script>
export default {
  created() {
    let mediaOpts = {
      video: true,
    };
    let that = this;
    function successFunc(stream) {
      console.log(stream)
      var video = that.$refs.video;
      video.srcObject = stream;
      video.play();
    }
    function errorFunc(err) {
      alert(err.name);
    }

    navigator.getUserMedia(mediaOpts, successFunc, errorFunc);
  },
};
</script>
